package com.zhongge.gui;

import com.zhongge.book.BookList;
import com.zhongge.user.User;

import javax.swing.*;

/**
 * 图形界面程序入口类
 */
public class GUIMain {
    private static BookList bookList;
    private static User currentUser;
    
    public static void main(String[] args) {
        // 初始化图书数据
        bookList = new BookList();
        
        // 设置Swing外观
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
            e.printStackTrace();
        }
        
        // 显示登录窗口
        SwingUtilities.invokeLater(() -> {
            LoginFrame loginFrame = new LoginFrame();
            loginFrame.setVisible(true);
        });
    }
    
    // Getter和Setter方法
    public static BookList getBookList() {
        return bookList;
    }
    
    public static User getCurrentUser() {
        return currentUser;
    }
    
    public static void setCurrentUser(User currentUser) {
        GUIMain.currentUser = currentUser;
    }
}